home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_teo_spiderblock.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  192 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEO_SpiderBlocks.cog
  4. #
  5. # Last in the stair script
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message     startup
  15.     message     activate
  16.     message     crossed
  17.     
  18.     surface        crossurf0       
  19.     surface        crossurf1        
  20.     
  21.     thing       player          local
  22.     thing       actorindy
  23.     thing       spiderCamPos
  24.     thing       doorCamPos    
  25.     thing       unlokblok        
  26.     thing        spiderblock         
  27.     thing       door0            
  28.     thing       door1
  29.     thing       spycam_tgt           
  30.  
  31.     flex        moveSpeed=10.0
  32.     flex        camSpeed=1.0
  33.     flex        camTimer=0.5
  34.     
  35.     sound       indylineb0=inxj058.wav      local
  36.     sound       indylineb1=inxj059.wav      local
  37.     sound       indylineb2=inxj060.wav      local
  38.     sound       indylineb3=inxj061.wav      local
  39.     sound       indylineb4=inxj090.wav      local
  40.     sound       indylineb5=inxj095.wav      local
  41.     
  42.     int         wepnum=1                    local
  43.     int         lastrand=-1                 local
  44.     int         currand=0                   local
  45.     int         door0chan       local
  46.     int         door1chan       local
  47.     int         spiderchan      local        
  48.     int         surfflag0=0     local                                       
  49.     int         surfflag1=0     local
  50.     int         check0=0        local
  51.     int         check1=0        local
  52.     int         check2=0        local
  53.         
  54.         
  55. end
  56.  
  57. # ========================================================================================
  58.  
  59. code
  60.  
  61. startup:
  62.  
  63.     player = GetLocalPlayerThing();
  64.     
  65. return;        
  66.  
  67. # ........................................................................................
  68.  
  69. activate:
  70.  
  71.     if ((GetSenderRef() == unlokblok) && 
  72.         (check2 == 0) && 
  73.         (GetCurItem(player) == 0) && 
  74.         (GetCurWeapon(player) == 0))
  75.     {
  76.         check2=1;
  77.         StartCutscene(1);
  78.         SetActorFlags(player, 0x200000);
  79.         StopThing(player);
  80.         PlayMode(player, 60, 0);
  81.         MoveToFrame(unlokblok, 1, 0.5);
  82.         Sleep(1);
  83.         SetCameraFocus(0, doorCamPos);
  84.         SetCurrentCamera(0);
  85.         MoveToFrame(door0, 0, (moveSpeed/10));
  86.         MoveToFrame(door1, 0, (moveSpeed/10));
  87.         WaitForStop(door0);
  88.         Sleep(1);
  89.         SetCurrentCamera(1);
  90.         ClearActorFlags(player, 0x200000);
  91.         EndCutscene();
  92.         return;
  93.     }
  94.     
  95.     if ((GetSenderRef() == unlokblok) && 
  96.         (check2 == 0) && 
  97.         (GetCurItem(player) == 0) && 
  98.         (GetCurWeapon(player) != 0))
  99.     {
  100.         check2=1;
  101.         StartCutscene(1);
  102.         SetActorFlags(player, 0x200000);
  103.         While(wepnum !=0)
  104.         {
  105.             wepnum = GetCurWeapon(player);
  106.             DeselectWeaponWait(player);
  107.         }
  108.         StopThing(player);
  109.         PlayMode(player, 60, 0);
  110.         MoveToFrame(unlokblok, 1, 0.5);
  111.         Sleep(1);
  112.         SetCameraFocus(0, doorCamPos);
  113.         SetCurrentCamera(0);
  114.         MoveToFrame(door0, 0, (moveSpeed/10));
  115.         MoveToFrame(door1, 0, (moveSpeed/10));
  116.         WaitForStop(door0);
  117.         Sleep(1);
  118.         SetCurrentCamera(1);
  119.         ClearActorFlags(player, 0x200000);
  120.         EndCutscene();
  121.         wepnum=1;
  122.         return;
  123.     }
  124.     
  125.     if ((GetCurItem(player) != 0) && (GetSenderRef() == unlokblok))
  126.     {
  127.         StopThing(player);
  128.         StartCutscene(1);
  129.         SetActorFlags(player, 0x200000);
  130.         currand = RandBetween(0, 5);
  131.         While (lastrand == currand)
  132.         {
  133.             currand = RandBetween(0, 5);
  134.         }
  135.         PlayVoice(player, indylineb0[currand], 1, 1);
  136.         lastrand = currand;
  137.         EndCutscene();
  138.         ClearActorFlags(player, 0x200000);
  139.     }                        
  140.     return;                      
  141.  
  142. # ........................................................................................
  143.  
  144. crossed:
  145.     if ((GetSenderRef() == crossurf0) &&
  146.        (check0 == 0))
  147.     {
  148.         check0=1;
  149.         MoveToFrame(door0, 1, moveSpeed);
  150.         surfflag0=1;
  151.     }
  152.         
  153.     if ((GetSenderRef() == crossurf1) &&
  154.        (check1 == 0) &&
  155.        (surfflag0 == 1))
  156.     {
  157.         check1=1;
  158.         MoveToFrame(door1, 1, moveSpeed);
  159.         MakeMeStop();
  160.         DeselectWeaponWait(player);
  161.         StartCutscene(1);
  162.         SetThingFlags(player, 0x80000);
  163.         ClearThingFlags(actorindy, 0x80000);
  164.         CopyPlayerHolsters(player, actorindy);
  165.         AISetCutsceneMode(actorindy);
  166.         
  167.         SetCameraFocus(2, spiderCamPos);
  168.         SetCameraSecondaryFocus(2, spycam_tgt);
  169.         SetCurrentCamera(2);
  170.         Sleep(0.5);
  171.         AISetLookThing(actorindy, unlokblok);
  172.         MoveToFrame(spycam_tgt, 1, (moveSpeed/10));
  173.         Sleep(1);
  174.         MoveToFrame(spiderblock, 1, 1);
  175.         WaitForStop(spiderblock);
  176.         Sleep(1);
  177.         
  178.         TeleportThing(player, actorindy);
  179.         SetThingFlags(actorindy, 0x80000);
  180.         ClearThingFlags(player, 0x80000);
  181.         SetCurrentCamera(1);
  182.         SetCameraFOV(90, 0, 0);
  183.         EndCutscene();
  184.         ClearActorFlags(player, 0x200000);
  185.     }                
  186.        return;
  187.  
  188. # ........................................................................................
  189.  
  190. end
  191.  
  192.